<template>
  <dv-charts :option="option"/>
</template>
<script>

import {  getLendChange } from '@/api/dataECharts'

export default {
  data() {
    return {
      list: [],
      option: {
        xAxis: {
          name: '日期',
          data: [1],
          axisLabel: {
            style: {
              fill: '#fff'
            }
          }
        },
        yAxis: {
          name: '数量',
          data: 'value',
          axisLabel: {
            style: { fill: '#fff' }
          },
          min: -1
        },
        series: [
          {
            data: [1],
            type: 'line'
          },
          {
            data: [1],
            type: 'line'
          }
        ]
      }
    }
  },
  methods: {
    async getList() {
      let data = await getLendChange({ year: '2024', month: '3' })
      this.option.xAxis.data = Object.keys(data).map(i => i.split('-')[2])
      this.option.series[0].data = Object.values(data)
      this.option = { ...this.option }
    }
  },
  mounted() {
    this.getList()
  }
}

</script>

<style scoped lang="scss">
.dv-scroll-ranking-board {
  width: 80%;
}
</style>
